{{- define "additional_relable_config_tier" }}
- source_labels: [namespace]
  regex: "d8-.+|kube-system|None"
  target_label: tier
  replacement: cluster
- source_labels: [namespace, tier]
  regex: "^;$"
  target_label: tier
  replacement: cluster
- source_labels: [tier]
  regex: "^$"
  target_label: tier
  replacement: application
{{- end }}
---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: prometheus-main-additional-configs-alert-relable-tier
  namespace: d8-monitoring
  {{- include "helm_lib_module_labels" (list . (dict "additional-configs-for-prometheus" "main")) | nindent 2 }}
data:
  alert-relabels.yaml: |
    {{ include "additional_relable_config_tier" . | b64enc }}
